﻿using JavaDevToys.Rcl.Global.Nav.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JavaDevToys.Rcl.Shared
{
    public partial class MainLayout
    {
        private List<NavItem> _navItems = new();

        private bool? _showSetting;

        protected override async Task OnAfterRenderAsync(bool firstRender)
        {
            await base.OnAfterRenderAsync(firstRender);

            if (firstRender)
            {
                _navItems = new List<NavItem>()
                {
                    new NavItem("主页", "/"),
                    new NavItem("产品设计工具", "mdi-creation", new List<NavItem>()
                    {
                        new NavItem("模型转Api文档", "/DesignCdmToDoc"),
                        new NavItem("表名转文档字段", "/DesignTableToDoc"),
                        new NavItem("内容转驼峰命名", "/DesignContextToDoc"),
                    }),
                    new NavItem("Java工程工具", "mdi-language-java", new List<NavItem>()
                    {
                        new NavItem("业务类生成", "/JavaService"),
                        new NavItem("模型类生成", "/JavaModel"),
                        new NavItem("数据访问类生成", "/JavaMapper"),
                        new NavItem("属性生成", "/JavaParameter"),
                        new NavItem("枚举生成", "/JavaEnum"),
                    }),
                    new NavItem("CSharp工程工具", "mdi-language-csharp", new List<NavItem>()
                    {
                        new NavItem("请求接口生成", "/CSharpBackService"),
                        new NavItem("请求模型生成", "/CSharpBackModel"),
                        new NavItem("属性生成", "/CSharpBackParameter"),
                    }),
                    new NavItem("接口开发工具", "mdi-expansion-card", new List<NavItem>()
                    {
                        new NavItem("项目生成", "/ExInterProject"),
                        new NavItem("文档解析", "/ExInterDoc"),
                    }),
                    new NavItem("常用代码", "/JavaCopyCode"),
                    new NavItem("Java模板设置", "/JavaTemp"),
                };
                StateHasChanged();
            }
        }
    }
}
